#!/usr/bin/env python3

import multiprocessing as mp
import os
import time

def Run(v, *args):
    print("child pid = ", os.getpid(), ", Run args: ", args)
    v.value = 88888
    time.sleep(5)
    v.value = 1999
    print("child exit....")


def main():
    print("main pid = ", os.getpid())

    v = mp.Value('i', 0)

    p = mp.Process(target=Run, args=(v, 123, "kyo"))
    p.start()
    time.sleep(2)
    print("parent v = ", v.value)
    p.join()
    print("child end parent v = ", v.value)

if __name__ == "__main__":
    main()
